package com.example.demo.bean


//Room number type
data class Room(
    val roomId: String,  //primary key
    val cost: Int,
    val type: String,
    val state: Int // 0 -> 空置  1-> 正在被使用
)

//orderId roomId consumerId startTime endTime
data class Od(
    val orderId: String,    //primary key
    val roomId: String,     //foreign key
    val consumerId: String, //foreign key
    val startTime: String, // yyyy-mm-dd
    val endTime: String,
    val extra: String,
    val state: Int,         // 0:ing 1:complete 2:cancel 3:none
    val allCost: Int    // 总价
)

//consumer
data class Consumer(
    val consumerId: String,//primary key
    val name: String,
    val phoneNumber: String
)

data class DetailOrder(
    val od: Od,
    val consumer: Consumer?,
    val room: Room?
)

/**
 * @property name String 员工用户名
 */
data class User(val name: String, val pwd: String)

data class BaseResponse<T>(
    val code: Int,
    val msg: String = if (code == SUCCESS) SUCCESS_MSG else FAILURE_MSG,
    val data: T? = null
)

const val SUCCESS = 0
const val FAILURE = 1
const val SUCCESS_MSG = "success"
const val FAILURE_MSG = "failure"